package com.study.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName students
 */
@TableName(value ="students")
@Data
public class Students implements Serializable {
    /**
     * 
     */
    @TableId(value = "student_id")
    private Integer student_id;

    /**
     * 
     */
    @TableField(value = "student_number")
    private String student_number;

    /**
     * 
     */
    @TableField(value = "enrollment_date")
    private Date enrollment_date;

    /**
     * 
     */
    @TableField(value = "major")
    private String major;

    /**
     * 
     */
    @TableField(value = "grade")
    private Integer grade;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Students other = (Students) that;
        return (this.getStudent_id() == null ? other.getStudent_id() == null : this.getStudent_id().equals(other.getStudent_id()))
            && (this.getStudent_number() == null ? other.getStudent_number() == null : this.getStudent_number().equals(other.getStudent_number()))
            && (this.getEnrollment_date() == null ? other.getEnrollment_date() == null : this.getEnrollment_date().equals(other.getEnrollment_date()))
            && (this.getMajor() == null ? other.getMajor() == null : this.getMajor().equals(other.getMajor()))
            && (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStudent_id() == null) ? 0 : getStudent_id().hashCode());
        result = prime * result + ((getStudent_number() == null) ? 0 : getStudent_number().hashCode());
        result = prime * result + ((getEnrollment_date() == null) ? 0 : getEnrollment_date().hashCode());
        result = prime * result + ((getMajor() == null) ? 0 : getMajor().hashCode());
        result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", student_id=").append(student_id);
        sb.append(", student_number=").append(student_number);
        sb.append(", enrollment_date=").append(enrollment_date);
        sb.append(", major=").append(major);
        sb.append(", grade=").append(grade);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}